package com.ms.oschina.tagpager;

import android.app.Activity;
import android.os.Bundle;

import com.ms.oschina.R;
import com.ms.oschina.adapter.ViewPagerFragmentAdapter;
import com.ms.oschina.base.BasePagerSlidingTabFragment;
import com.ms.oschina.bean.Constants;
import com.ms.oschina.fragment.TwistInfoFragment;
import com.ms.oschina.util.LogUtils;
import com.ms.oschina.util.UiUtils;

public class TweetFragment extends BasePagerSlidingTabFragment {

	private Class[] fragments = new Class[] { TwistInfoFragment.class,
			TwistInfoFragment.class, TwistInfoFragment.class };

	public static final int NEWESTTWIST = 101;
	public static final int HOTSPOTTWIST = 102;
	public static final int MYTWIST = 103;

	private int[] mark = new int[] { NEWESTTWIST, HOTSPOTTWIST, MYTWIST };

	@Override
	public void addTab(ViewPagerFragmentAdapter adapter) {
		String[] titles = UiUtils
				.getStringArray(R.array.tweets_viewpage_arrays);

		for (int i = 0; i < titles.length; i++) {
			Bundle args = new Bundle();
			args.putInt(Constants.ARGS, mark[i]);
			adapter.addTab(titles[i], fragments[i], args);
		}
	}

	public int offscreenPageLimit() {
		return 3;
	}

}
